package com.hl.service.serviceImpl;

import com.hl.domain.Heartexpert;
import com.hl.mapper.HeartexpertMapper;
import com.hl.service.HeartexpertService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import javax.print.DocFlavor;
import java.util.List;

@Service
public class HeartexpertServiceImpl implements HeartexpertService {

    @Autowired
    private HeartexpertMapper heartexpertMapper;

//    查询所有
    @Override
    public List<Heartexpert> selectAll() {
        return heartexpertMapper.selectAll();
    }

//    根据id查询
    @Override
    public Heartexpert selectById(Long id) {
        return heartexpertMapper.selectByPrimaryKey(id);
    }

//    根据name查询
    @Override
    public Heartexpert selectByName(String name) {
        return heartexpertMapper.selectByName(name);
    }

//    模糊查询
    @Override
    public List<Heartexpert> selectLike(String title) {
        return heartexpertMapper.selectLike(title);
    }

//    新增
    @Override
    public int insert(Heartexpert heartexpert) {
        return heartexpertMapper.insert(heartexpert);
    }

//    删除
    @Override
    public int delete(Long id) {
        return heartexpertMapper.deleteByPrimaryKey(id);
    }

//    修改
    @Override
    public int update(Heartexpert heartexpert) {
        return heartexpertMapper.updateByPrimaryKey(heartexpert);
    }





}
